package top.cardone.api.v1.usercenter.user

import org.apache.commons.lang3.StringUtils
import top.cardone.usercenter.service.UserService
import top.cardone.context.ApplicationContextHolder
import top.cardone.core.CodeException

class modifyModal implements java.io.Serializable {
    def input(input) {
        ["userId": "userId"]
    }

    def validation(input) {
//      if (StringUtils.isBlank(input?.userId)) {
//          throw new CodeException("userId required", "用户标识必填")
//      }
    }

    def func(input) {
		ApplicationContextHolder.getBean(UserService.class).findOneByUserId(input)
    }

    def output(output) {
        def newOutput = [:]

		newOutput['address'] = output['address']
		newOutput['age'] = output['age']
		newOutput['aliasName'] = output['aliasName']
		newOutput['areaCode'] = output['areaCode']
		newOutput['batchNo'] = output['batchNo']
		newOutput['beginDate'] = output['beginDate']
		newOutput['birthday'] = output['birthday']
		newOutput['callName'] = output['callName']
		newOutput['cityCode'] = output['cityCode']
		newOutput['companyName'] = output['companyName']
		newOutput['contact'] = output['contact']
		newOutput['countryCode'] = output['countryCode']
		newOutput['createdByCode'] = output['createdByCode']
		newOutput['createdDate'] = output['createdDate']
		newOutput['dataStateCode'] = output['dataStateCode']
		newOutput['departmentCode'] = output['departmentCode']
		newOutput['diplomaCode'] = output['diplomaCode']
		newOutput['email'] = output['email']
		newOutput['endDate'] = output['endDate']
		newOutput['firstName'] = output['firstName']
		newOutput['flagCode'] = output['flagCode']
		newOutput['flagObjectCode'] = output['flagObjectCode']
		newOutput['folkCode'] = output['folkCode']
		newOutput['idCardCode'] = output['idCardCode']
		newOutput['idCardNo'] = output['idCardNo']
		newOutput['intro'] = output['intro']
		newOutput['jsonData'] = output['jsonData']
		newOutput['lastModifiedByCode'] = output['lastModifiedByCode']
		newOutput['lastModifiedDate'] = output['lastModifiedDate']
		newOutput['lastName'] = output['lastName']
		newOutput['locus'] = output['locus']
		newOutput['marryStateCode'] = output['marryStateCode']
		newOutput['mobilePhone'] = output['mobilePhone']
		newOutput['name'] = output['name']
		newOutput['namePinyin'] = output['namePinyin']
		newOutput['orderBy'] = output['orderBy']
		newOutput['orgCode'] = output['orgCode']
		newOutput['password'] = output['password']
		newOutput['passwordSalt'] = output['passwordSalt']
		newOutput['personalCode'] = output['personalCode']
		newOutput['portraitUrl'] = output['portraitUrl']
		newOutput['privatePassword'] = output['privatePassword']
		newOutput['privatePasswordSalt'] = output['privatePasswordSalt']
		newOutput['professionCode'] = output['professionCode']
		newOutput['provinceCode'] = output['provinceCode']
		newOutput['qq'] = output['qq']
		newOutput['regionCode'] = output['regionCode']
		newOutput['remark'] = output['remark']
		newOutput['sexCode'] = output['sexCode']
		newOutput['siteCode'] = output['siteCode']
		newOutput['stateCode'] = output['stateCode']
		newOutput['systemInfoCode'] = output['systemInfoCode']
		newOutput['telephone'] = output['telephone']
		newOutput['userCode'] = output['userCode']
		newOutput['userId'] = output['userId']
		newOutput['version'] = output['version']

        newOutput
    }
}